package armazenador.ip;

import static org.junit.Assert.*;

import java.sql.SQLException;

import org.junit.After;
import org.junit.Before;
import org.junit.Test;

import jogoBolaoeArmazenador.rn.Usuario;

public class IPBolaoTeste {
	
	Usuario user, carlos;
	IPUsuario database;
	
	@Before
	public void setUp() throws ClassNotFoundException, SQLException{
		database = new IPUsuario();
		user = new Usuario ("name", "generico", "key");
		carlos = database.recuperar(1);
	}
	
	@After
	public void tearDown(){
		database = null;
		user = null;
		carlos = null;
	}
	
	@Test
	public void autenticaUsuarioTest() throws ClassNotFoundException, SQLException{
		assertFalse(database.autenticaUsuario(user));
		assertTrue(database.autenticaUsuario(carlos));
	}

}
